<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Lodolist</title>
    <script src="https://unpkg.com/vue"></script>
    <script>
        window.onload=function(){
            var app=new Vue({
                el:'#app',
                methods:{
                    addthing:function(){
                        this.todo.push({ name:this.thing,done:false });
                    },
                    data: {
                        thing:null,
                        todos: [
                            { name: '吃饭',done:false},
                            { name: '睡觉',done:false},
                            {name:'哈哈哈',done:true}
                        ]
                    }
                }
            })
        }
    </script>
</head>
<body>
<div id="app">
    <input type="text" v-model="thing"/>
    <button v-on:click="addthing">添加</button>
    <div v-for="(todo,idx) in todos">
        <input type="checkbox">{{idx}}.{{todo.name}}
    </div>


</div>

</body>
</html>